.class public Lcom/ninesky/browser/DownloadActivity;
.super Landroid/app/Activity;

# interfaces
.implements Landroid/view/View$OnClickListener;
.implements Landroid/widget/AdapterView$OnItemClickListener;


# instance fields
.field private final a:Ljava/lang/String;

.field private final b:Z

.field private c:Landroid/widget/ListView;

.field private d:Landroid/database/Cursor;

.field private e:Lcom/ninesky/browser/w;

.field private f:I

.field private g:I

.field private h:I

.field private i:Landroid/widget/Button;

.field private j:Landroid/widget/Button;

.field private k:Landroid/widget/Button;

.field private l:J

.field private m:Landroid/content/BroadcastReceiver;

.field private n:Landroid/content/IntentFilter;

.field private o:Landroid/app/AlertDialog;

.field private p:Lcom/ninesky/widget/l;

.field private q:Lcom/ninesky/widget/l;

.field private r:Lcom/ninesky/widget/l;

.field private s:Lcom/ninesky/widget/l;

.field private t:Lcom/ninesky/browser/provider/downloads/r;

.field private u:Landroid/view/View$OnClickListener;

.field private v:Landroid/view/View$OnClickListener;

.field private w:Landroid/view/View$OnClickListener;

.field private x:Landroid/view/View$OnClickListener;

.field private y:Landroid/view/View$OnClickListener;


# direct methods
.method public constructor <init>()V
    .locals 1

    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    const-string v0, "NSBrowser.DownloadActivity"

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->a:Ljava/lang/String;

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/ninesky/browser/DownloadActivity;->b:Z

    new-instance v0, Lcom/ninesky/browser/cn;

    invoke-direct {v0, p0}, Lcom/ninesky/browser/cn;-><init>(Lcom/ninesky/browser/DownloadActivity;)V

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->u:Landroid/view/View$OnClickListener;

    new-instance v0, Lcom/ninesky/browser/cm;

    invoke-direct {v0, p0}, Lcom/ninesky/browser/cm;-><init>(Lcom/ninesky/browser/DownloadActivity;)V

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->v:Landroid/view/View$OnClickListener;

    new-instance v0, Lcom/ninesky/browser/cl;

    invoke-direct {v0, p0}, Lcom/ninesky/browser/cl;-><init>(Lcom/ninesky/browser/DownloadActivity;)V

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->w:Landroid/view/View$OnClickListener;

    new-instance v0, Lcom/ninesky/browser/cq;

    invoke-direct {v0, p0}, Lcom/ninesky/browser/cq;-><init>(Lcom/ninesky/browser/DownloadActivity;)V

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->x:Landroid/view/View$OnClickListener;

    new-instance v0, Lcom/ninesky/browser/cp;

    invoke-direct {v0, p0}, Lcom/ninesky/browser/cp;-><init>(Lcom/ninesky/browser/DownloadActivity;)V

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->y:Landroid/view/View$OnClickListener;

    return-void
.end method

.method private a()V
    .locals 3

    const/4 v2, 0x1

    const/4 v1, 0x0

    invoke-direct {p0}, Lcom/ninesky/browser/DownloadActivity;->c()I

    move-result v0

    if-lez v0, :cond_0

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->j:Landroid/widget/Button;

    invoke-virtual {v0, v2}, Landroid/widget/Button;->setEnabled(Z)V

    :goto_0
    invoke-direct {p0}, Lcom/ninesky/browser/DownloadActivity;->e()I

    move-result v0

    if-lez v0, :cond_1

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->i:Landroid/widget/Button;

    invoke-virtual {v0, v2}, Landroid/widget/Button;->setEnabled(Z)V

    :goto_1
    return-void

    :cond_0
    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->j:Landroid/widget/Button;

    invoke-virtual {v0, v1}, Landroid/widget/Button;->setEnabled(Z)V

    goto :goto_0

    :cond_1
    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->i:Landroid/widget/Button;

    invoke-virtual {v0, v1}, Landroid/widget/Button;->setEnabled(Z)V

    goto :goto_1
.end method

.method static synthetic a(Lcom/ninesky/browser/DownloadActivity;)V
    .locals 6

    const/4 v5, 0x0

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    iget v1, p0, Lcom/ninesky/browser/DownloadActivity;->f:I

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v0

    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    const-string v2, "visibility"

    invoke-interface {v1, v2}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v1

    iget-object v2, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-interface {v2, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    invoke-static {v0}, Lcom/ninesky/browser/provider/downloads/e;->d(I)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    if-ne v1, v0, :cond_0

    new-instance v0, Landroid/content/ContentValues;

    invoke-direct {v0}, Landroid/content/ContentValues;-><init>()V

    const-string v1, "visibility"

    const/4 v2, 0x0

    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    invoke-virtual {p0}, Lcom/ninesky/browser/DownloadActivity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    sget-object v2, Lcom/ninesky/browser/provider/downloads/e;->a:Landroid/net/Uri;

    iget-object v3, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    iget v4, p0, Lcom/ninesky/browser/DownloadActivity;->g:I

    invoke-interface {v3, v4}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v3

    invoke-static {v2, v3, v4}, Landroid/content/ContentUris;->withAppendedId(Landroid/net/Uri;J)Landroid/net/Uri;

    move-result-object v2

    invoke-virtual {v1, v2, v0, v5, v5}, Landroid/content/ContentResolver;->update(Landroid/net/Uri;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I

    :cond_0
    return-void
.end method

.method static synthetic a(Lcom/ninesky/browser/DownloadActivity;J)V
    .locals 7

    const/4 v2, 0x1

    const/4 v6, 0x0

    const-wide/16 v0, -0x1

    cmp-long v0, p1, v0

    if-eqz v0, :cond_1

    invoke-virtual {p0}, Lcom/ninesky/browser/DownloadActivity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v3, "_id=?"

    new-array v4, v2, [Ljava/lang/String;

    invoke-static {p1, p2}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

    move-result-object v1

    aput-object v1, v4, v6

    sget-object v1, Lcom/ninesky/browser/provider/downloads/e;->a:Landroid/net/Uri;

    new-array v2, v2, [Ljava/lang/String;

    const-string v5, "_data"

    aput-object v5, v2, v6

    const/4 v5, 0x0

    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v0

    if-eqz v0, :cond_0

    invoke-interface {v0}, Landroid/database/Cursor;->getCount()I

    move-result v1

    if-gtz v1, :cond_2

    :cond_0
    if-eqz v0, :cond_1

    invoke-interface {v0}, Landroid/database/Cursor;->isClosed()Z

    move-result v1

    if-nez v1, :cond_1

    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    :cond_1
    :goto_0
    return-void

    :cond_2
    invoke-interface {v0}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v1

    if-eqz v1, :cond_3

    const-string v1, "_data"

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v1

    if-eqz v1, :cond_3

    new-instance v2, Ljava/io/File;

    invoke-direct {v2, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2}, Ljava/io/File;->exists()Z

    move-result v1

    if-eqz v1, :cond_3

    invoke-virtual {v2}, Ljava/io/File;->delete()Z

    :cond_3
    if-eqz v0, :cond_4

    invoke-interface {v0}, Landroid/database/Cursor;->isClosed()Z

    move-result v1

    if-nez v1, :cond_4

    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    :cond_4
    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->t:Lcom/ninesky/browser/provider/downloads/r;

    invoke-virtual {v0, p1, p2}, Lcom/ninesky/browser/provider/downloads/r;->a(J)V

    goto :goto_0
.end method

.method static synthetic a([Lcom/ninesky/widget/g;)V
    .locals 4

    array-length v0, p0

    const/4 v1, 0x0

    :goto_0
    if-lt v1, v0, :cond_0

    return-void

    :cond_0
    aget-object v2, p0, v1

    if-eqz v2, :cond_1

    invoke-virtual {v2}, Lcom/ninesky/widget/g;->b()Z

    move-result v3

    if-eqz v3, :cond_1

    invoke-virtual {v2}, Lcom/ninesky/widget/g;->c()V

    :cond_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_0
.end method

.method private b()V
    .locals 6

    const/4 v3, 0x0

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-interface {v0}, Landroid/database/Cursor;->isClosed()Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    :cond_0
    invoke-virtual {p0}, Lcom/ninesky/browser/DownloadActivity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    sget-object v1, Lcom/ninesky/browser/provider/downloads/e;->a:Landroid/net/Uri;

    const/16 v2, 0xa

    new-array v2, v2, [Ljava/lang/String;

    const/4 v4, 0x0

    const-string v5, "_id"

    aput-object v5, v2, v4

    const/4 v4, 0x1

    const-string v5, "title"

    aput-object v5, v2, v4

    const/4 v4, 0x2

    const-string v5, "status"

    aput-object v5, v2, v4

    const/4 v4, 0x3

    const-string v5, "total_bytes"

    aput-object v5, v2, v4

    const/4 v4, 0x4

    const-string v5, "current_bytes"

    aput-object v5, v2, v4

    const/4 v4, 0x5

    const-string v5, "_data"

    aput-object v5, v2, v4

    const/4 v4, 0x6

    const-string v5, "description"

    aput-object v5, v2, v4

    const/4 v4, 0x7

    const-string v5, "mimetype"

    aput-object v5, v2, v4

    const/16 v4, 0x8

    const-string v5, "lastmod"

    aput-object v5, v2, v4

    const/16 v4, 0x9

    const-string v5, "visibility"

    aput-object v5, v2, v4

    const-string v5, "_id DESC"

    move-object v4, v3

    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v0

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->e:Lcom/ninesky/browser/w;

    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-virtual {v0, v1}, Lcom/ninesky/browser/w;->changeCursor(Landroid/database/Cursor;)V

    return-void
.end method

.method static synthetic b(Lcom/ninesky/browser/DownloadActivity;)V
    .locals 8

    const/4 v7, 0x0

    const v6, 0x7f07015a

    const v5, 0x7f070155

    const v4, 0x7f070005

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    const-string v1, "_data"

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-interface {v1, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    if-nez v0, :cond_0

    new-instance v0, Landroid/app/AlertDialog$Builder;

    invoke-direct {v0, p0}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    invoke-virtual {v0, v5}, Landroid/app/AlertDialog$Builder;->setTitle(I)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    invoke-virtual {v0, v6}, Landroid/app/AlertDialog$Builder;->setMessage(I)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    invoke-virtual {v0, v4, v7}, Landroid/app/AlertDialog$Builder;->setPositiveButton(ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    invoke-virtual {v0}, Landroid/app/AlertDialog$Builder;->show()Landroid/app/AlertDialog;

    move-result-object v0

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->o:Landroid/app/AlertDialog;

    :goto_0
    return-void

    :cond_0
    new-instance v1, Ljava/io/File;

    invoke-direct {v1, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    move-result v2

    if-nez v2, :cond_1

    new-instance v0, Landroid/app/AlertDialog$Builder;

    invoke-direct {v0, p0}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    invoke-virtual {v0, v5}, Landroid/app/AlertDialog$Builder;->setTitle(I)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    invoke-virtual {v0, v6}, Landroid/app/AlertDialog$Builder;->setMessage(I)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    invoke-virtual {v0, v4, v7}, Landroid/app/AlertDialog$Builder;->setPositiveButton(ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    invoke-virtual {v0}, Landroid/app/AlertDialog$Builder;->show()Landroid/app/AlertDialog;

    move-result-object v0

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->o:Landroid/app/AlertDialog;

    goto :goto_0

    :cond_1
    iget-object v2, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    const-string v3, "mimetype"

    invoke-interface {v2, v3}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v2

    iget-object v3, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-interface {v3, v2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v0

    invoke-virtual {v0}, Landroid/net/Uri;->getScheme()Ljava/lang/String;

    move-result-object v3

    if-nez v3, :cond_2

    invoke-static {v1}, Landroid/net/Uri;->fromFile(Ljava/io/File;)Landroid/net/Uri;

    move-result-object v0

    :cond_2
    new-instance v1, Landroid/content/Intent;

    const-string v3, "android.intent.action.VIEW"

    invoke-direct {v1, v3}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, v0, v2}, Landroid/content/Intent;->setDataAndType(Landroid/net/Uri;Ljava/lang/String;)Landroid/content/Intent;

    const/high16 v0, 0x400

    invoke-virtual {v1, v0}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

    :try_start_0
    invoke-virtual {p0, v1}, Lcom/ninesky/browser/DownloadActivity;->startActivity(Landroid/content/Intent;)V
    :try_end_0
    .catch Landroid/content/ActivityNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    const-string v1, "NSBrowser.DownloadActivity"

    invoke-virtual {v0}, Landroid/content/ActivityNotFoundException;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v1, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    new-instance v0, Landroid/app/AlertDialog$Builder;

    invoke-direct {v0, p0}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    invoke-virtual {v0, v5}, Landroid/app/AlertDialog$Builder;->setTitle(I)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    invoke-virtual {v0, v6}, Landroid/app/AlertDialog$Builder;->setMessage(I)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    invoke-virtual {v0, v4, v7}, Landroid/app/AlertDialog$Builder;->setPositiveButton(ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    invoke-virtual {v0}, Landroid/app/AlertDialog$Builder;->show()Landroid/app/AlertDialog;

    move-result-object v0

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->o:Landroid/app/AlertDialog;

    goto :goto_0
.end method

.method private c()I
    .locals 3

    const/4 v0, 0x0

    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    if-eqz v1, :cond_0

    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-interface {v1}, Landroid/database/Cursor;->moveToFirst()Z

    :goto_0
    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-interface {v1}, Landroid/database/Cursor;->isAfterLast()Z

    move-result v1

    if-eqz v1, :cond_1

    :cond_0
    return v0

    :cond_1
    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    iget v2, p0, Lcom/ninesky/browser/DownloadActivity;->f:I

    invoke-interface {v1, v2}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    invoke-static {v1}, Lcom/ninesky/browser/provider/downloads/e;->d(I)Z

    move-result v1

    if-nez v1, :cond_2

    add-int/lit8 v0, v0, 0x1

    :cond_2
    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-interface {v1}, Landroid/database/Cursor;->moveToNext()Z

    goto :goto_0
.end method

.method static synthetic c(Lcom/ninesky/browser/DownloadActivity;)Lcom/ninesky/widget/l;
    .locals 1

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->q:Lcom/ninesky/widget/l;

    return-object v0
.end method

.method static synthetic d(Lcom/ninesky/browser/DownloadActivity;)J
    .locals 2

    iget-wide v0, p0, Lcom/ninesky/browser/DownloadActivity;->l:J

    return-wide v0
.end method

.method private d()V
    .locals 4

    invoke-direct {p0}, Lcom/ninesky/browser/DownloadActivity;->c()I

    move-result v0

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    const v1, 0x7f070152

    const/4 v2, 0x1

    new-array v2, v2, [Ljava/lang/Object;

    const/4 v3, 0x0

    invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    aput-object v0, v2, v3

    invoke-virtual {p0, v1, v2}, Lcom/ninesky/browser/DownloadActivity;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    new-instance v1, Landroid/app/AlertDialog$Builder;

    invoke-direct {v1, p0}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    const v2, 0x7f070151

    invoke-virtual {v1, v2}, Landroid/app/AlertDialog$Builder;->setTitle(I)Landroid/app/AlertDialog$Builder;

    move-result-object v1

    invoke-virtual {v1, v0}, Landroid/app/AlertDialog$Builder;->setMessage(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    const v1, 0x7f070005

    new-instance v2, Lcom/ninesky/browser/dc;

    invoke-direct {v2, p0}, Lcom/ninesky/browser/dc;-><init>(Lcom/ninesky/browser/DownloadActivity;)V

    invoke-virtual {v0, v1, v2}, Landroid/app/AlertDialog$Builder;->setPositiveButton(ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    const v1, 0x7f070006

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/app/AlertDialog$Builder;->setNegativeButton(ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    invoke-virtual {v0}, Landroid/app/AlertDialog$Builder;->show()Landroid/app/AlertDialog;

    move-result-object v0

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->o:Landroid/app/AlertDialog;

    goto :goto_0
.end method

.method private e()I
    .locals 3

    const/4 v0, 0x0

    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-interface {v1}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v1

    if-eqz v1, :cond_0

    :goto_0
    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-interface {v1}, Landroid/database/Cursor;->isAfterLast()Z

    move-result v1

    if-eqz v1, :cond_1

    :cond_0
    return v0

    :cond_1
    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    iget v2, p0, Lcom/ninesky/browser/DownloadActivity;->f:I

    invoke-interface {v1, v2}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    invoke-static {v1}, Lcom/ninesky/browser/provider/downloads/e;->d(I)Z

    move-result v1

    if-eqz v1, :cond_2

    add-int/lit8 v0, v0, 0x1

    :cond_2
    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-interface {v1}, Landroid/database/Cursor;->moveToNext()Z

    goto :goto_0
.end method

.method static synthetic e(Lcom/ninesky/browser/DownloadActivity;)V
    .locals 0

    invoke-direct {p0}, Lcom/ninesky/browser/DownloadActivity;->b()V

    return-void
.end method

.method static synthetic f(Lcom/ninesky/browser/DownloadActivity;)V
    .locals 0

    invoke-direct {p0}, Lcom/ninesky/browser/DownloadActivity;->a()V

    return-void
.end method

.method static synthetic g(Lcom/ninesky/browser/DownloadActivity;)Lcom/ninesky/widget/l;
    .locals 1

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->r:Lcom/ninesky/widget/l;

    return-object v0
.end method

.method static synthetic h(Lcom/ninesky/browser/DownloadActivity;)Lcom/ninesky/widget/l;
    .locals 1

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->p:Lcom/ninesky/widget/l;

    return-object v0
.end method

.method static synthetic i(Lcom/ninesky/browser/DownloadActivity;)Lcom/ninesky/widget/l;
    .locals 1

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->s:Lcom/ninesky/widget/l;

    return-object v0
.end method

.method static synthetic j(Lcom/ninesky/browser/DownloadActivity;)Landroid/app/AlertDialog;
    .locals 1

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->o:Landroid/app/AlertDialog;

    return-object v0
.end method

.method static synthetic k(Lcom/ninesky/browser/DownloadActivity;)V
    .locals 4

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-interface {v0}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v0

    if-eqz v0, :cond_0

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const/4 v1, 0x1

    :goto_0
    iget-object v2, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-interface {v2}, Landroid/database/Cursor;->isAfterLast()Z

    move-result v2

    if-eqz v2, :cond_1

    if-nez v1, :cond_0

    invoke-virtual {p0}, Lcom/ninesky/browser/DownloadActivity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    sget-object v2, Lcom/ninesky/browser/provider/downloads/e;->a:Landroid/net/Uri;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const/4 v3, 0x0

    invoke-virtual {v1, v2, v0, v3}, Landroid/content/ContentResolver;->delete(Landroid/net/Uri;Ljava/lang/String;[Ljava/lang/String;)I

    :cond_0
    return-void

    :cond_1
    iget-object v2, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    iget v3, p0, Lcom/ninesky/browser/DownloadActivity;->f:I

    invoke-interface {v2, v3}, Landroid/database/Cursor;->getInt(I)I

    move-result v2

    invoke-static {v2}, Lcom/ninesky/browser/provider/downloads/e;->d(I)Z

    move-result v2

    if-eqz v2, :cond_2

    if-eqz v1, :cond_3

    const/4 v1, 0x0

    :goto_1
    const-string v2, "( "

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v2, "_id"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v2, " = \'"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v2, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    iget v3, p0, Lcom/ninesky/browser/DownloadActivity;->g:I

    invoke-interface {v2, v3}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v2

    invoke-virtual {v0, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string v2, "\' )"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    :cond_2
    iget-object v2, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-interface {v2}, Landroid/database/Cursor;->moveToNext()Z

    goto :goto_0

    :cond_3
    const-string v2, " OR "

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    goto :goto_1
.end method

.method static synthetic l(Lcom/ninesky/browser/DownloadActivity;)V
    .locals 4

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-interface {v0}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v0

    if-eqz v0, :cond_0

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const/4 v1, 0x1

    :goto_0
    iget-object v2, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-interface {v2}, Landroid/database/Cursor;->isAfterLast()Z

    move-result v2

    if-eqz v2, :cond_1

    if-nez v1, :cond_0

    invoke-virtual {p0}, Lcom/ninesky/browser/DownloadActivity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    sget-object v2, Lcom/ninesky/browser/provider/downloads/e;->a:Landroid/net/Uri;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const/4 v3, 0x0

    invoke-virtual {v1, v2, v0, v3}, Landroid/content/ContentResolver;->delete(Landroid/net/Uri;Ljava/lang/String;[Ljava/lang/String;)I

    :cond_0
    return-void

    :cond_1
    iget-object v2, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    iget v3, p0, Lcom/ninesky/browser/DownloadActivity;->f:I

    invoke-interface {v2, v3}, Landroid/database/Cursor;->getInt(I)I

    move-result v2

    invoke-static {v2}, Lcom/ninesky/browser/provider/downloads/e;->d(I)Z

    move-result v2

    if-nez v2, :cond_2

    if-eqz v1, :cond_3

    const/4 v1, 0x0

    :goto_1
    const-string v2, "( "

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v2, "_id"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v2, " = \'"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v2, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    iget v3, p0, Lcom/ninesky/browser/DownloadActivity;->g:I

    invoke-interface {v2, v3}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v2

    invoke-virtual {v0, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string v2, "\' )"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    :cond_2
    iget-object v2, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-interface {v2}, Landroid/database/Cursor;->moveToNext()Z

    goto :goto_0

    :cond_3
    const-string v2, " OR "

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    goto :goto_1
.end method


# virtual methods
.method public onClick(Landroid/view/View;)V
    .locals 3

    invoke-virtual {p1}, Landroid/view/View;->getId()I

    move-result v0

    sparse-switch v0, :sswitch_data_0

    :goto_0
    return-void

    :sswitch_0
    invoke-direct {p0}, Lcom/ninesky/browser/DownloadActivity;->e()I

    move-result v0

    if-eqz v0, :cond_0

    new-instance v0, Landroid/app/AlertDialog$Builder;

    invoke-direct {v0, p0}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    const v1, 0x7f07014f

    invoke-virtual {v0, v1}, Landroid/app/AlertDialog$Builder;->setTitle(I)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    const v1, 0x7f070150

    invoke-virtual {v0, v1}, Landroid/app/AlertDialog$Builder;->setMessage(I)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    const v1, 0x7f070005

    new-instance v2, Lcom/ninesky/browser/da;

    invoke-direct {v2, p0}, Lcom/ninesky/browser/da;-><init>(Lcom/ninesky/browser/DownloadActivity;)V

    invoke-virtual {v0, v1, v2}, Landroid/app/AlertDialog$Builder;->setPositiveButton(ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    const v1, 0x7f070006

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/app/AlertDialog$Builder;->setNegativeButton(ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    invoke-virtual {v0}, Landroid/app/AlertDialog$Builder;->show()Landroid/app/AlertDialog;

    move-result-object v0

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->o:Landroid/app/AlertDialog;

    :cond_0
    const-string v0, "Download"

    const-string v1, "ClearAll"

    invoke-static {p0, v0, v1}, Lcom/mobclick/android/c;->a(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0

    :sswitch_1
    invoke-direct {p0}, Lcom/ninesky/browser/DownloadActivity;->d()V

    const-string v0, "Download"

    const-string v1, "CancelAll"

    invoke-static {p0, v0, v1}, Lcom/mobclick/android/c;->a(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0

    :sswitch_2
    invoke-virtual {p0}, Lcom/ninesky/browser/DownloadActivity;->finish()V

    const-string v0, "Download"

    const-string v1, "Back"

    invoke-static {p0, v0, v1}, Lcom/mobclick/android/c;->a(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0

    nop

    :sswitch_data_0
    .sparse-switch
        0x7f0c0012 -> :sswitch_2
        0x7f0c0029 -> :sswitch_0
        0x7f0c002a -> :sswitch_1
    .end sparse-switch
.end method

.method public onCreate(Landroid/os/Bundle;)V
    .locals 6

    const/4 v3, 0x0

    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    const v0, 0x7f03000e

    invoke-virtual {p0, v0}, Lcom/ninesky/browser/DownloadActivity;->setContentView(I)V

    const v0, 0x7f070148

    invoke-virtual {p0, v0}, Lcom/ninesky/browser/DownloadActivity;->getText(I)Ljava/lang/CharSequence;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/ninesky/browser/DownloadActivity;->setTitle(Ljava/lang/CharSequence;)V

    const v0, 0x7f0c0027

    invoke-virtual {p0, v0}, Lcom/ninesky/browser/DownloadActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ListView;

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->c:Landroid/widget/ListView;

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->c:Landroid/widget/ListView;

    const v1, 0x7f0c0028

    invoke-virtual {p0, v1}, Lcom/ninesky/browser/DownloadActivity;->findViewById(I)Landroid/view/View;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setEmptyView(Landroid/view/View;)V

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->c:Landroid/widget/ListView;

    invoke-virtual {v0, p0}, Landroid/widget/ListView;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V

    invoke-virtual {p0}, Lcom/ninesky/browser/DownloadActivity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    sget-object v1, Lcom/ninesky/browser/provider/downloads/e;->a:Landroid/net/Uri;

    const/16 v2, 0xa

    new-array v2, v2, [Ljava/lang/String;

    const/4 v4, 0x0

    const-string v5, "_id"

    aput-object v5, v2, v4

    const/4 v4, 0x1

    const-string v5, "title"

    aput-object v5, v2, v4

    const/4 v4, 0x2

    const-string v5, "status"

    aput-object v5, v2, v4

    const/4 v4, 0x3

    const-string v5, "total_bytes"

    aput-object v5, v2, v4

    const/4 v4, 0x4

    const-string v5, "current_bytes"

    aput-object v5, v2, v4

    const/4 v4, 0x5

    const-string v5, "_data"

    aput-object v5, v2, v4

    const/4 v4, 0x6

    const-string v5, "description"

    aput-object v5, v2, v4

    const/4 v4, 0x7

    const-string v5, "mimetype"

    aput-object v5, v2, v4

    const/16 v4, 0x8

    const-string v5, "lastmod"

    aput-object v5, v2, v4

    const/16 v4, 0x9

    const-string v5, "visibility"

    aput-object v5, v2, v4

    const-string v5, "_id DESC"

    move-object v4, v3

    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v1

    iput-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    new-instance v1, Lcom/ninesky/browser/provider/downloads/r;

    invoke-virtual {p0}, Lcom/ninesky/browser/DownloadActivity;->getPackageName()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v0, v2}, Lcom/ninesky/browser/provider/downloads/r;-><init>(Landroid/content/ContentResolver;Ljava/lang/String;)V

    iput-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->t:Lcom/ninesky/browser/provider/downloads/r;

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    const-string v1, "status"

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/ninesky/browser/DownloadActivity;->f:I

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    const-string v1, "_id"

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/ninesky/browser/DownloadActivity;->g:I

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    const-string v1, "title"

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/ninesky/browser/DownloadActivity;->h:I

    new-instance v0, Lcom/ninesky/browser/w;

    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-direct {v0, p0, v1}, Lcom/ninesky/browser/w;-><init>(Landroid/content/Context;Landroid/database/Cursor;)V

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->e:Lcom/ninesky/browser/w;

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->c:Landroid/widget/ListView;

    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->e:Lcom/ninesky/browser/w;

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->c:Landroid/widget/ListView;

    const/high16 v1, 0x100

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setScrollBarStyle(I)V

    :cond_0
    new-instance v0, Landroid/content/IntentFilter;

    invoke-direct {v0}, Landroid/content/IntentFilter;-><init>()V

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->n:Landroid/content/IntentFilter;

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->n:Landroid/content/IntentFilter;

    const-string v1, "android.intent.action.DOWNLOAD_COMPLETED"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    new-instance v0, Lcom/ninesky/browser/co;

    invoke-direct {v0, p0}, Lcom/ninesky/browser/co;-><init>(Lcom/ninesky/browser/DownloadActivity;)V

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->m:Landroid/content/BroadcastReceiver;

    const v0, 0x7f0c0029

    invoke-virtual {p0, v0}, Lcom/ninesky/browser/DownloadActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/Button;

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->i:Landroid/widget/Button;

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->i:Landroid/widget/Button;

    invoke-virtual {v0, p0}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    const v0, 0x7f0c002a

    invoke-virtual {p0, v0}, Lcom/ninesky/browser/DownloadActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/Button;

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->j:Landroid/widget/Button;

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->j:Landroid/widget/Button;

    invoke-virtual {v0, p0}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    const v0, 0x7f0c0012

    invoke-virtual {p0, v0}, Lcom/ninesky/browser/DownloadActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/Button;

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->k:Landroid/widget/Button;

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->k:Landroid/widget/Button;

    invoke-virtual {v0, p0}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    invoke-direct {p0}, Lcom/ninesky/browser/DownloadActivity;->a()V

    return-void
.end method

.method protected onDestroy()V
    .locals 1

    invoke-super {p0}, Landroid/app/Activity;->onDestroy()V

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-interface {v0}, Landroid/database/Cursor;->isClosed()Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    :cond_0
    return-void
.end method

.method public onItemClick(Landroid/widget/AdapterView;Landroid/view/View;IJ)V
    .locals 8

    const v2, 0x7f070067

    const v7, 0x7f070066

    const v6, 0x7f07014c

    const v5, 0x7f020051

    const v4, 0x7f020046

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->d:Landroid/database/Cursor;

    iget v1, p0, Lcom/ninesky/browser/DownloadActivity;->f:I

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v0

    iput-wide p4, p0, Lcom/ninesky/browser/DownloadActivity;->l:J

    invoke-static {v0}, Lcom/ninesky/browser/provider/downloads/e;->b(I)Z

    move-result v1

    if-eqz v1, :cond_1

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->q:Lcom/ninesky/widget/l;

    if-nez v0, :cond_0

    new-instance v0, Lcom/ninesky/widget/l;

    invoke-direct {v0, p0}, Lcom/ninesky/widget/l;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->q:Lcom/ninesky/widget/l;

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->q:Lcom/ninesky/widget/l;

    const v1, 0x7f02005a

    const v2, 0x7f07014a

    iget-object v3, p0, Lcom/ninesky/browser/DownloadActivity;->u:Landroid/view/View$OnClickListener;

    invoke-virtual {v0, v1, v2, v3}, Lcom/ninesky/widget/l;->a(IILandroid/view/View$OnClickListener;)Landroid/view/View;

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->q:Lcom/ninesky/widget/l;

    const v1, 0x7f07014b

    iget-object v2, p0, Lcom/ninesky/browser/DownloadActivity;->v:Landroid/view/View$OnClickListener;

    invoke-virtual {v0, v4, v1, v2}, Lcom/ninesky/widget/l;->a(IILandroid/view/View$OnClickListener;)Landroid/view/View;

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->q:Lcom/ninesky/widget/l;

    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->y:Landroid/view/View$OnClickListener;

    invoke-virtual {v0, v5, v7, v1}, Lcom/ninesky/widget/l;->a(IILandroid/view/View$OnClickListener;)Landroid/view/View;

    :cond_0
    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->q:Lcom/ninesky/widget/l;

    :goto_0
    invoke-virtual {v0, p2}, Lcom/ninesky/widget/l;->b(Landroid/view/View;)V

    return-void

    :cond_1
    invoke-static {v0}, Lcom/ninesky/browser/provider/downloads/e;->a(I)Z

    move-result v1

    if-eqz v1, :cond_3

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->s:Lcom/ninesky/widget/l;

    if-nez v0, :cond_2

    new-instance v0, Lcom/ninesky/widget/l;

    invoke-direct {v0, p0}, Lcom/ninesky/widget/l;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->s:Lcom/ninesky/widget/l;

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->s:Lcom/ninesky/widget/l;

    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->x:Landroid/view/View$OnClickListener;

    invoke-virtual {v0, v5, v2, v1}, Lcom/ninesky/widget/l;->a(IILandroid/view/View$OnClickListener;)Landroid/view/View;

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->s:Lcom/ninesky/widget/l;

    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->v:Landroid/view/View$OnClickListener;

    invoke-virtual {v0, v4, v6, v1}, Lcom/ninesky/widget/l;->a(IILandroid/view/View$OnClickListener;)Landroid/view/View;

    :cond_2
    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->s:Lcom/ninesky/widget/l;

    goto :goto_0

    :cond_3
    invoke-static {v0}, Lcom/ninesky/browser/provider/downloads/e;->c(I)Z

    move-result v0

    if-eqz v0, :cond_5

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->r:Lcom/ninesky/widget/l;

    if-nez v0, :cond_4

    new-instance v0, Lcom/ninesky/widget/l;

    invoke-direct {v0, p0}, Lcom/ninesky/widget/l;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->r:Lcom/ninesky/widget/l;

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->r:Lcom/ninesky/widget/l;

    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->x:Landroid/view/View$OnClickListener;

    invoke-virtual {v0, v5, v2, v1}, Lcom/ninesky/widget/l;->a(IILandroid/view/View$OnClickListener;)Landroid/view/View;

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->r:Lcom/ninesky/widget/l;

    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->y:Landroid/view/View$OnClickListener;

    invoke-virtual {v0, v5, v7, v1}, Lcom/ninesky/widget/l;->a(IILandroid/view/View$OnClickListener;)Landroid/view/View;

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->r:Lcom/ninesky/widget/l;

    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->v:Landroid/view/View$OnClickListener;

    invoke-virtual {v0, v4, v6, v1}, Lcom/ninesky/widget/l;->a(IILandroid/view/View$OnClickListener;)Landroid/view/View;

    :cond_4
    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->r:Lcom/ninesky/widget/l;

    goto :goto_0

    :cond_5
    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->p:Lcom/ninesky/widget/l;

    if-nez v0, :cond_6

    new-instance v0, Lcom/ninesky/widget/l;

    invoke-direct {v0, p0}, Lcom/ninesky/widget/l;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->p:Lcom/ninesky/widget/l;

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->p:Lcom/ninesky/widget/l;

    const v1, 0x7f02005c

    const v2, 0x7f070013

    iget-object v3, p0, Lcom/ninesky/browser/DownloadActivity;->w:Landroid/view/View$OnClickListener;

    invoke-virtual {v0, v1, v2, v3}, Lcom/ninesky/widget/l;->a(IILandroid/view/View$OnClickListener;)Landroid/view/View;

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->p:Lcom/ninesky/widget/l;

    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->v:Landroid/view/View$OnClickListener;

    invoke-virtual {v0, v4, v6, v1}, Lcom/ninesky/widget/l;->a(IILandroid/view/View$OnClickListener;)Landroid/view/View;

    :cond_6
    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->p:Lcom/ninesky/widget/l;

    goto :goto_0
.end method

.method protected onPause()V
    .locals 1

    invoke-super {p0}, Landroid/app/Activity;->onPause()V

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->m:Landroid/content/BroadcastReceiver;

    invoke-virtual {p0, v0}, Lcom/ninesky/browser/DownloadActivity;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    invoke-static {p0}, Lcom/mobclick/android/c;->a(Landroid/content/Context;)V

    return-void
.end method

.method protected onResume()V
    .locals 2

    invoke-super {p0}, Landroid/app/Activity;->onResume()V

    iget-object v0, p0, Lcom/ninesky/browser/DownloadActivity;->m:Landroid/content/BroadcastReceiver;

    iget-object v1, p0, Lcom/ninesky/browser/DownloadActivity;->n:Landroid/content/IntentFilter;

    invoke-virtual {p0, v0, v1}, Lcom/ninesky/browser/DownloadActivity;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    invoke-virtual {p0}, Lcom/ninesky/browser/DownloadActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    if-eqz v0, :cond_0

    invoke-virtual {v0}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-direct {p0}, Lcom/ninesky/browser/DownloadActivity;->b()V

    invoke-direct {p0}, Lcom/ninesky/browser/DownloadActivity;->a()V

    :cond_0
    invoke-static {p0}, Lcom/mobclick/android/c;->b(Landroid/content/Context;)V

    return-void
.end method
